import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.guigu.www.dao.bean.TMember;
import com.guigu.www.dao.bean.TOrderInfo;
import com.guigu.www.service.TMemberService;
import com.guigu.www.service.TOrderInfoService;
import config.Spring;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

public class Demo {

    @Test
    public void t(){
        AnnotationConfigApplicationContext k=new AnnotationConfigApplicationContext(Spring.class);
        TMemberService bean = k.getBean(TMemberService.class);
        List<TMember> tMembers = bean.selectList(new EntityWrapper<TMember>().eq("name", "tt"));
        System.out.println(tMembers);
    }

    @Test
    public void t1(){
        AnnotationConfigApplicationContext k=new AnnotationConfigApplicationContext(Spring.class);
        /*TMemberService bean = k.getBean(TMemberService.class);
        TMember tMember = bean.selectOne(null);
        tMember.setName("tt");
        boolean id = bean.update(tMember, new EntityWrapper<TMember>().eq("id", "1"));
        System.out.println(id);*/

        TOrderInfoService a=k.getBean(TOrderInfoService.class);
        a.insert(new TOrderInfo().setName("你好"));

    }
}
